package com.lvfuyang.commonproject.config;

import com.lvfuyang.commonproject.interceptor.JwtVerify;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器配置专用
 * addPathPatterns：添加需要拦截的路径
 * excludePathPatterns：添加不需要拦截的路径
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JwtVerify())
                .addPathPatterns("/**")
                .excludePathPatterns("/auth/**")
                .excludePathPatterns("/crypto/**");
    }
}
